<?php
include_once($_SERVER['DOCUMENT_ROOT']."/BT32/database/database.php");

class llhs extends database{
	private $maso;
	private $hoten;
	private $ngaysinh;
	private $gioitinh;
	private $doanvien;
	private $tongiao;
	private $cha;
	private $nghecha;
	private $me;
	private $ngheme;
	private $diachi;

	public function setmaso($maso){
		$this->maso = $maso;
	}

	public function sethoten($hoten){
		$this->hoten = $hoten;
	}

	public function setngaysinh($ngaysinh){
		$this->ngaysinh = $ngaysinh;
	}

	public function setgioitinh($gioitinh){
		$this->gioitinh = $gioitinh;
	}

	public function setdoanvien($doanvien){
		$this->doanvien =$doanvien;
	}

	public function settongiao($tongiao){
		$this->tongiao = $tongiao;
	}

	public function setcha($cha){
		$this->cha = $cha;
	}

	public function setnghecha($nghecha){
		$this->nghecha = $nghecha;
	}

	public function setme($me){
		$this->me = $me;
	}

	public function setngheme($ngheme){
		$this->ngheme = $ngheme;
	}

	public function setdiachi($diachi){
		$this->diachi =$diachi;
	}


	public function gethoten(){
		return $this->hoten;
	}

	public function getmaso(){
		return $this->maso;
	}

	public function getngaysinh(){
		return $this->ngaysinh;
	}

	public function getgioitinh(){
		return $this->gioitinh;
	}

	public function getdoanvien(){
		return $this->doanvien;
	}

	public function gettongiao(){
		return $this->tongiao;
	}

	public function getcha(){
		return $this->cha;
	}

	public function getnghecha(){
		return $this->nghecha;
	}

	public function getme(){
		return $this->me;
	}

	public function getngheme(){
		return $this->ngheme;
	}

	public function getdiachi(){
		return $this->diachi;
	}

	public function themllhs(){
		$query = "insert into llhs(maso, hoten, ngaysinh, gioitinh, doanvien, tongiao, cha, nghecha, me, ngheme, diachi) 
		values ('". $this->getmaso() ."', '". $this->gethoten() ."', '". $this->getngaysinh() ."', '". $this->getgioitinh() ."', '". $this->getdoanvien() ."', '". $this->gettongiao() ."', '". $this->getcha() ."', '". $this->getnghecha() ."', '". $this->getme() ."', '". $this->getngheme() ."', '". $this->getdiachi() ."')";
		$this->setQuery($query);
        return $this->executeQuery();
	}

	public function suallhs(){
		$query = "update llhs set hoten='". $this->gethoten() ."', ngaysinh='". $this->getngaysinh() ."', gioitinh='". $this->getgioitinh() ."', doanvien='". $this->getdoanvien() ."', tongiao='". $this->gettongiao() ."', cha='". $this->getcha() ."', nghecha='". $this->getnghecha() ."', me='". $this->getme() ."', ngheme='". $this->getngheme() ."', diachi='". $this->getdiachi() ."'";
		$query .= " where maso = '". $this->getmaso() ."'";
		$this->setQuery($query);
        return $this->executeQuery();
	}

	public function xoallhs(){
		$this->setQuery("delete from llhs where maso='". $this->getmaso() ."'");
		$this->setQuery($query);
        return $this->executeQuery();
	}

	public function dsgv(){
		$this->setQuery("select * from llhs");
		return $this->fetchAll();
	}

	// danh sách học sinh theo lớp
	// danh sách học sinh theo học lực, hạnh kiểm

	// 
}
?>